-- cure_boss
-- create by wangy
-- 技能: 怪物恢复boss目标总生命值，根据威力和攻击计算


return {
    apply = function(source, target, skillId, round, para, extra)
        -- 4. 遍历所有的怪
        local ret = {};

        for p = 1, DUNGEON_WIDTH * DUNGEON_HEIGHT do
            local grid = DungeonM.getGridByPos(p);

            -- 是未死亡的怪物
            if  grid:isOpened() and
                grid:isMonster() and grid.monster:isBoss() and
                not grid.monster:isDead() then
                table.insert(ret, grid.monster);
            end
        end

        for _, monster in pairs(ret) do
            -- 1. 威力
            local force = para[1];

            -- 2. 施展方的魔力
            local attack = source:getAttack();

            -- 3. 作用
            local hp = math.modf(force * attack / 1000);

            CombatM.receiveCure(source, monster, hp);
         end
         return { target, };
    end,

    parse = function(desc)
        local arr = string.explode(desc, ",");
        return { tonumber(arr[1]), };
    end,

    -- 解析技能描述
    parseDesc = function(source, skillId, desc, para)
        return desc;
    end,
}

